﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<GIFT_SHOP_MVC.Models.RegisterModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Register
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Register</h2>

    <% using (Html.BeginForm("Register")) {%>

        <fieldset>
            <legend>Register Information</legend>
            <table style="width: 100%" cellspacing="20">
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.UserName) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.UserName) %>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.UserName) %>
                        <% if (Session["available"]!=null && (bool)Session["available"] == false) Response.Write("UserName already exists !"); %></b>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.Password) %>
                    </td>
                    <td>
                        <%: Html.PasswordFor(model => model.Password) %>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.Password) %></b>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.ConfirmPassword) %>
                    </td>
                    <td>
                        <%: Html.PasswordFor(model => model.ConfirmPassword)%>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.ConfirmPassword) %></b>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.Name) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Name) %>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.Name) %></b>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.Address) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Address) %>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.Address) %></b> 
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.Phone) %>
                    </td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Phone) %>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.Phone) %></b> 
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;</td>
                    <td>
                        <img src="../../Content/images/captcha.jpg" alt="" width="150px" height="50px"/>                        
                        </td>
                </tr>
                <tr>
                    <td align="right">
                        <%: Html.LabelFor(model => model.Captcha) %></td>
                    <td>
                        <%: Html.TextBoxFor(model => model.Captcha)%>
                        <b style="color:Red;"><%: Html.ValidationMessageFor(model => model.Captcha)%>
                        <% if (Session["correct"] != null && (bool)Session["correct"] == false) Response.Write("Captcha is not correct !"); %></b>
                    </td>
                </tr>
                <tr>
                    <td align="left">
                        <b style="color:Red;"><%: Html.ValidationSummary(true) %></b></td>
                    <td>
                        <input type="submit" id="submit_btn" value="Register" />
                    </td>
                </tr>
            </table>
        </fieldset>
    <% } %>

</asp:Content>

